# Copyright 2010 Michael Penhallegon

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import pathloader
from dj import Section, Page, Feeds
from dj.Photos import Photos

from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.loader  import get_template
from django.template import RequestContext
from django.views.decorators.csrf import csrf_protect
from dj.blog import views as blogviews 

def about(request):
    '''Creates the about page of the website'''

    # Get the about page article from Articles
    page = Section.AboutData()

    # Create a new Photos class and retrieve the photos from that
    photos = Photos(pathloader.paths['photopass'],pathloader.paths['photouser'])
    context = blogviews.blogrender(page)
    context['photos'] = photos.geturls()

    return render_to_response('aboutme.html',context)

def robot(request):
    return HttpResponse(open('robots.txt').read(), 'text/plain')
def links(request):
	page = Section.LinkData()
	context = blogviews.blogrender(page)
	return render_to_response('links.html',context)
